#ifndef ELEMENTMANAGER_H
#define ELEMENTMANAGER_H

#include <QObject>
#include "vo/superelement.h"
#include "load/elementload.h"

class ElementManager
{
public:
    void init();

    static ElementManager& instance();

    void load();

    QList<SuperElement *> getElementList(const QString &key) const;

    QHash<QString, QList<SuperElement *> > getMap() const;

    void setElementByPx(int row, int col, const SuperElement &superElement);
    void setElementByIndex(int row, int col, const SuperElement &superElement);

    SuperElement *getElementPyPx(int row, int col) const;
    SuperElement *getElementPyIndex(int row, int col) const;
private:
    QHash<QString, QList<SuperElement *>> m_map;
    QList<QList<SuperElement *>> m_objects;

};

#endif // ELEMENTMANAGER_H
